<?php
namespace app\back\model;


use app\common\model\ConfigComm;

class ConfigModel extends ConfigComm
{


    ///获取指定position数据
    public function getIndexDataListByPosition($config_position){
        return $this->getIndexDataListByWhereMap(['config_position'=>$config_position]);
    }


    ///获取网站标题
    public function getWebTitle(){
        return $this->getStringValByCode('web_comm_header_title');
    }


    ///根据配置id和配置position获取数据
    public function getOneDataByIDAndPosition($data_id,$config_position){
        return  $this->where('id',$data_id)
            ->where('config_position',$config_position)
            ->field('id,config_title,config_value')
            ->find();
    }

    ///根据配置id和配置position修改数据
    public function updateDataByIDAndPosition($config_id,$config_position,$config_value,$update_time){
        return $this->where('id',$config_id)
            ->where('config_position',$config_position)
            ->update(compact('config_value','update_time'));
    }

}